<?php
set_time_limit (24*60*60);//设定程序执行时间
$images_folder = 'images/';//设定写入图上的目录
$url = 'http://wangtao.name/wp-content/uploads/2009/12/2.png'; //远程图片URL
$newfname = $images_folder . basename($url);//写入后的存放路径与地址
$file = fopen($url,'rb');
if($file)
{
	$newf = fopen ($newfname,'wb');
	if($newf)
	{
		while(!feof($file))
		{
			fwrite($newf,fread($file, 2048*8),2048*8);
		}
		return true;
	}
	if($file)
	{
		fclose($file);
	}
	if($newf)
	{
		fclose($newf);
	}
}
$s = '';
if(empty($s))
{
	echo 'ohoho';
}
else
{
	echo 'nono';
}
/*
$a = 1; 
$b = 2; 
	 
function Sum() 
{
	global $a, $b; 
	$c = $a + $b; 
	return $c;
}

class c
{
	static function s()
	{
		global $a;
		$c = $a;
		return $c;
	}
}
echo c::s();
*/